home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Varsity Update 1998 August
/
SGI Varsity Update 1998 August.iso
/
dist
/
dist6.5
/
il_dev.idb
/
usr
/
include
/
il
/
ilScaleImg.h.z
/
ilScaleImg.h
Wrap
C/C++ Source or Header
|
1998-07-29
|
3KB
|
84 lines
#if 0
Copyright (c) 1991 SGI All Rights Reserved
THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
The copyright notice above does not evidence any
actual or intended publication of such source code,
and is an unpublished work by Silicon Graphics, Inc.
This material contains CONFIDENTIAL INFORMATION that
is the property of Silicon Graphics, Inc. Any use,
duplication or disclosure not specifically authorized
by Silicon Graphics is strictly prohibited.
RESTRICTED RIGHTS LEGEND:
Use, duplication or disclosure by the Government is
subject to restrictions as set forth in subdivision
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 52.227-7013, and/or in similar
or successor clauses in the FAR, DOD or NASA FAR
Supplement. Unpublished- rights reserved under the
Copyright Laws of the United States. Contractor is
SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
Mountain View, CA 94039-7311
#endif
/*
This class implements a simple linear scaling of an image.
*/
#ifndef _ilScaleImg_h_
#define _ilScaleImg_h_
#if defined(IL2_5_COMPAT)
#include <il/ilPixel.h>
#endif
#include <ifl/iflPixel.h>
#include <il/ilMonadicImg.h>
class ilScaleImg : public ilMonadicImg {
public:
iflClassListDeclare
~ilScaleImg();
// external api: begin
ilScaleImg(ilImage* img = NULL);
// external api: name=ilScaleImgDomain
ilScaleImg(ilImage* img, double inMin, double inMax,
double outMin=0, double outMax=255);
void setRange(double outMin, double outMax);
void resetRange() { if (rangeSet) { rangeSet = FALSE; setAltered(); } }
void setDomain(double inMin, double inMax);
void resetDomain() { if (domainSet) { domainSet = FALSE; setAltered(); } }
void setScaling(double slope, double intercept);
void resetScaling() { if (scalingSet) { scalingSet = FALSE; setAltered(); } }
double getSlope() { resetCheck(); return slope; }
double getIntercept() { resetCheck(); return intercept; }
void getDomain(double& inMin, double& inMax)
{ resetCheck(); inMin = minIn; inMax = maxIn; }
void getRange(double& outMin, double& outMax)
{ resetCheck(); outMin = minOut; outMax = maxOut; }
int isRangeSet() { resetCheck(); return rangeSet; }
int isDomainSet() { resetCheck(); return domainSet; }
int isScalingSet() { resetCheck(); return scalingSet; }
// external api: end
protected:
virtual ilStatus calcPage(void* inBuf, void* outBuf, ilMpCacheRequest& req);
virtual void resetOp();
virtual ilHwOp* hwDefine();
void initDomain(double inMin, double inMax);
void computeScale();
private:
void init(ilImage* img);
double minIn, maxIn, minOut, maxOut;
double slope, intercept;
double minClip, maxClip;
int domainSet, scalingSet, rangeSet;
};
#endif